<template>
  <div class="not-found">
    <div class="content">
      <h1>404</h1>
      <h2>页面不存在</h2>
      <p>您访问的页面不存在或已被删除</p>
      <el-button type="primary" @click="goHome">返回首页</el-button>
    </div>
  </div>
</template>

<script lang="ts" setup>
/**
 * 404页面组件
 *
 * 功能：
 * 1. 显示友好的404错误页面
 * 2. 提供返回首页的功能
 */
import {useRouter} from 'vue-router';

const router = useRouter();

/**
 * 返回首页
 */
const goHome = () => {
  router.push('/');
};
</script>

<style scoped>
.not-found {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f0f2f5;
  text-align: center;
}

.content {
  padding: 48px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

h1 {
  font-size: 72px;
  font-weight: bold;
  color: #409eff;
  margin-bottom: 16px;
  line-height: 1;
}

h2 {
  font-size: 24px;
  color: rgba(0, 0, 0, 0.85);
  margin-bottom: 16px;
}

p {
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 24px;
}
</style> 